var _EsdDynamicTransformationFunction = function($){
/**
 * 命名空间定义
 */
var _EsdDynamicTransformationScript = {};
_EsdDynamicTransformationScript.navBlock = {}; // 定义区域跳转类
_EsdDynamicTransformationScript.navBlock.selector = {};
/**
 * 文本链接 a
 */
//保证所有a标签都有href
$("a").each(function(){

	var aHref = this.href;
	if( aHref=="" || aHref==undefined ){
			$(this).attr("href","javascript:void(0)");
	}
	
	//给a标签加title
	var aTitle = this.title;
	var aText = this.text;
	
	if( aTitle=="" || aTitle==undefined ){
		if( aText!="" || aText!=undefined ){
			$(this).attr("title",$.trim(aText));
		}
	}
	
});
/**
 * 图片处理片段
 */

$('img[src="./ztzl/tjcyryyzsxxx/images/P020190822311494985696.png"]').attr('title','统计从业人员严重失信信息公示').attr('alt','统计从业人员严重失信信息公示');$('img[src="./ztzl/sgs/images/P020181102548544676965.png"]').attr('title','行政许可和行政处罚“双公示”').attr('alt','行政许可和行政处罚“双公示”');$('img[src="./dmtj/201908/W020190816356964439250.jpg"]').attr('title','什么是法人单位').attr('alt','什么是法人单位');$('img[src="./zwgk/tpxw/201809/W020181009352625607874.png"]').attr('title','国务院办公厅开通“国家政务服务投诉与建议”小程序').attr('alt','国务院办公厅开通“国家政务服务投诉与建议”小程序');$('img[src="./zwgk/tpxw/201911/W020191106530560609462.png"]').attr('title','省统计局局长苏衡深入登记现场督导全省人口变动调查工作并慰问调查员').attr('alt','省统计局局长苏衡深入登记现场督导全省人口变动调查工作并慰问调查员');$('img[src="./zwgk/tpxw/201909/W020190924523080409331.png"]').attr('title','省统计局与调查总队共同举办第十届统计开放日活动').attr('alt','省统计局与调查总队共同举办第十届统计开放日活动');$('img[src="../images/zly_tjfg4_20180919.png"]').attr('title','地方性统计法规和规章及规范性文件').attr('alt','地方性统计法规和规章及规范性文件');$('img[src="./ztzl/tjssxqy/images/P020181224510892273116.jpg"]').attr('title','统计上失信企业公示').attr('alt','统计上失信企业公示');$('img[src="./ldcyjqfg/201809/W020180929555652156251.png"]').attr('title','苏衡照片').attr('alt','苏衡照片');$('img[src="./images/dmtj_tjj201811192.jpg"]').attr('title','动漫统计').attr('alt','动漫统计');$('img[src="../images/zly_tjfg3_20180919.png"]').attr('title','统计部门规章及规范性文件').attr('alt','统计部门规章及规范性文件');$('img[src="../images/zly_tjfg1_20180919.png"]').attr('title','统计法律').attr('alt','统计法律');$('img[src="./qt/banner/201809/W020180927595495775655.png"]').attr('title','数据查询').attr('alt','数据查询');$('img[src="../images/zly_tjfg2_20180919.png"]').attr('title','统计行政法规').attr('alt','统计行政法规');$('img[src="./zwgk/tpxw/201812/W020181221520115331018.png"]').attr('title','2019“我向总理说句话”网民建言征集活动启动').attr('alt','2019“我向总理说句话”网民建言征集活动启动');$('img[src="./images/zly_logo_20180913.png"]').attr('title','吉林省统计局').attr('alt','吉林省统计局');$('img[src="./zwgk/tpxw/201904/W020190402473797853960.jpg"]').attr('title','扫黑除恶 吉林亮剑').attr('alt','扫黑除恶 吉林亮剑');$('img[src="./images/zly_zmhd_20180914.png"]').attr('title','政民互动').attr('alt','政民互动');$('img[src="./images/zly_20180920top.png"]').attr('title','回顶部按钮').attr('alt','回顶部按钮');$('img[src="./dmtj/201909/W020190927393103183351.png"]').attr('title','普查取得资料可作为实施处罚的依据吗').attr('alt','普查取得资料可作为实施处罚的依据吗');$('img[src="../images/zly_tjfg5_20180919.png"]').attr('title','地方性统计部门工作制度').attr('alt','地方性统计部门工作制度');$('img[src="./dmtj/201907/W020190724622014416047.jpg"]').attr('title','应如何做好普查指导员普查员的培训工作').attr('alt','应如何做好普查指导员普查员的培训工作');$('img[src="./images/zly_wsbs_20180914.png"]').attr('title','网上办事').attr('alt','网上办事');

//img
$("img").each(function(){
	//给图片加alt/title
	var imgAlt = this.alt,
		imgTitle = this.title,
		imgSrc = this.src,
		parentText = this.parentElement.text;

	if(this.alt=="" || this.alt==undefined){
		if(imgTitle!="" && imgTitle!=undefined){
			$(this).attr("alt",imgTitle);
		}else if(parentText!="" && parentText!=undefined){
			$(this).attr("alt",parentText);
		}
	}
	if(this.title=="" || this.title==undefined){
		if(imgAlt!="" && imgAlt!=undefined){
			$(this).attr("title",imgAlt);
		}else if(parentText!="" && parentText!=undefined){
			$(this).attr("title",parentText);
		}
	}
})

$("img").each(function(){
	if( (this.alt=="" && this.title=="")||(this.alt==undefined && this.title==undefined) ){
		$(this).attr("title","图片");
		$(this).attr("alt","图片");
	}
})
/**
 * 共通头部
 */
$("form[name='form_cds'] input[type='submit']").attr("title","搜索");
/**
 * 主导航
 */


//轮播,原点和a的title合一起了--鼠标移动触发情况

//轮播：只获取轮播中一个a标签。
//以文字a标签为主，图片a标签尽量不要，title不稳定
	_EsdDynamicTransformationScript.slidePointInterval = setInterval(function () {
		if ($("#demo3 .tips .nums a:eq(4)")[0] != undefined) {
            clearInterval(_EsdDynamicTransformationScript.slidePointInterval);
			//轮播前的标签
			_EsdDynamicTransformationScript.esdTagFrontNum1 = $(".zly_ss form .zly_ss_btn");
			//原点和a的title合一起了
			_EsdDynamicTransformationScript.esdTagCircleNum1 = $("#demo3 .tips .nums a:eq(0)");
			_EsdDynamicTransformationScript.esdTagCircleNum2 = $("#demo3 .tips .nums a:eq(1)");
			_EsdDynamicTransformationScript.esdTagCircleNum3 = $("#demo3 .tips .nums a:eq(2)");
			_EsdDynamicTransformationScript.esdTagCircleNum4 = $("#demo3 .tips .nums a:eq(3)");
			_EsdDynamicTransformationScript.esdTagCircleNum5 = $("#demo3 .tips .nums a:eq(4)");
			//轮播后的标签
			_EsdDynamicTransformationScript.esdTagAfterNum1 = $(".zly_yq:eq(0) .zly_20180914bt h2 a");
			
			//轮播前的焦点
			_EsdDynamicTransformationScript.esdTagFrontNum1.focus(function (e) {
				$(document).bind("keydown.keydown_0", function (e) {
					if(e.shiftKey&&e.keyCode==9){
						
					}else if (e.keyCode == 9) {
						if(_EsdDynamicTransformationScript.esdTagCircleNum1.length!=0){
							_EsdDynamicTransformationScript.esdTagCircleNum1.mouseover();
							_EsdDynamicTransformationScript.esdTagCircleNum1.focus();
							console.log(document.activeElement);
							return false;
						}
					}
				});
			});
			_EsdDynamicTransformationScript.esdTagFrontNum1.blur(function () {
				$(document).unbind("keydown.keydown_0");
			});
			
		
			//第一块
			_EsdDynamicTransformationScript.esdTagCircleNum1.focus(function (e) {
				
//				_EsdDynamicTransformationScript.esdTagCircleNum1.mouseover();
				$(document).bind("keydown.keydown_1", function (e) {
					if(e.shiftKey&&e.keyCode==9){
						_EsdDynamicTransformationScript.esdTagFrontNum1.focus();
						return false;
					}else if (e.keyCode == 9) {
						_EsdDynamicTransformationScript.esdTagCircleNum2.mouseover();
						_EsdDynamicTransformationScript.esdTagCircleNum2.focus();
						console.log(document.activeElement);
						return false;
					}
				});
		
			});
			_EsdDynamicTransformationScript.esdTagCircleNum1.blur(function () {
				$(document).unbind("keydown.keydown_1");
			});
		
			//第二块
			_EsdDynamicTransformationScript.esdTagCircleNum2.focus(function (e) {
				
//				_EsdDynamicTransformationScript.esdTagCircleNum2.mouseover();
				$(document).bind("keydown.keydown_2", function (e) {
					if(e.shiftKey&&e.keyCode==9){
						_EsdDynamicTransformationScript.esdTagCircleNum1.mouseover();
						_EsdDynamicTransformationScript.esdTagCircleNum1.focus();
						return false;
					}else if (e.keyCode == 9) {
						_EsdDynamicTransformationScript.esdTagCircleNum3.mouseover();
						_EsdDynamicTransformationScript.esdTagCircleNum3.focus();
						console.log(document.activeElement);
						return false;
					}
				});
		
			});
			_EsdDynamicTransformationScript.esdTagCircleNum2.blur(function () {
				$(document).unbind("keydown.keydown_2");
			});
			
			//第三块
			_EsdDynamicTransformationScript.esdTagCircleNum3.focus(function (e) {
				
//				_EsdDynamicTransformationScript.esdTagCircleNum3.mouseover();
				$(document).bind("keydown.keydown_3", function (e) {
					if(e.shiftKey&&e.keyCode==9){
						_EsdDynamicTransformationScript.esdTagCircleNum2.mouseover();
						_EsdDynamicTransformationScript.esdTagCircleNum2.focus();
						return false;
					}else if (e.keyCode == 9) {
						_EsdDynamicTransformationScript.esdTagCircleNum4.mouseover();
						_EsdDynamicTransformationScript.esdTagCircleNum4.focus();
						console.log(document.activeElement);
						return false;
					}
				});
		
			});
			_EsdDynamicTransformationScript.esdTagCircleNum3.blur(function () {
				$(document).unbind("keydown.keydown_3");
			});
			
			//第四块
			_EsdDynamicTransformationScript.esdTagCircleNum4.focus(function (e) {
				
//				_EsdDynamicTransformationScript.esdTagCircleNum4.mouseover();
				$(document).bind("keydown.keydown_4", function (e) {
					if(e.shiftKey&&e.keyCode==9){
						_EsdDynamicTransformationScript.esdTagCircleNum3.mouseover();
						_EsdDynamicTransformationScript.esdTagCircleNum3.focus();
						return false;
					}else if (e.keyCode == 9) {
						_EsdDynamicTransformationScript.esdTagCircleNum5.mouseover();
						_EsdDynamicTransformationScript.esdTagCircleNum5.focus();
						console.log(document.activeElement);
						return false;
					}
				});
		
			});
			_EsdDynamicTransformationScript.esdTagCircleNum4.blur(function () {
				$(document).unbind("keydown.keydown_4");
			});
			
			
			
			//第四块
			_EsdDynamicTransformationScript.esdTagCircleNum5.focus(function (e) {
				
//				_EsdDynamicTransformationScript.esdTagCircleNum5.mouseover();
				$(document).bind("keydown.keydown_5", function (e) {
					if(e.shiftKey&&e.keyCode==9){
						_EsdDynamicTransformationScript.esdTagCircleNum4.mouseover();
						_EsdDynamicTransformationScript.esdTagCircleNum4.focus();
						return false;
					}else if (e.keyCode == 9) {
						if(_EsdDynamicTransformationScript.esdTagAfterNum1.length!=0){
							_EsdDynamicTransformationScript.esdTagAfterNum1.focus();
							return false;
						}
					}
				});
		
			});
			_EsdDynamicTransformationScript.esdTagCircleNum5.blur(function () {
				$(document).unbind("keydown.keydown_5");
			});
			
			
			//轮播后的焦点
			_EsdDynamicTransformationScript.esdTagAfterNum1.focus(function (e) {
				
				$(document).bind("keydown.keydown_6", function (e) {
					if(e.shiftKey&&e.keyCode==9){
						_EsdDynamicTransformationScript.esdTagCircleNum5.mouseover();
						_EsdDynamicTransformationScript.esdTagCircleNum5.focus();
						return false;
					}else if (e.keyCode == 9) {
						
					}
				});
		
			});
			_EsdDynamicTransformationScript.esdTagAfterNum1.blur(function () {
				$(document).unbind("keydown.keydown_6");
			});
		}
	}, 500);	
/**
 * 主页js
 */

if (location.href =="http://tjj.jl.gov.cn/index.html" || location.href =="http://tjj.jl.gov.cn/") {
    //第一部分
    //二层

    //各个选项名称对应的内容数量
    _EsdDynamicTransformationScript.num1 = $("#con div:eq(0) a").length - 1;
    _EsdDynamicTransformationScript.num2 = $("#con div:eq(1) a").length - 1;

    //各个选项名称
    _EsdDynamicTransformationScript.esd1TagNum1 = $("#tit li:eq(0) a");
    _EsdDynamicTransformationScript.esd1TagNum2 = $("#tit li:eq(1) a");

    //各个选项中的第一个内容
    _EsdDynamicTransformationScript.esd1TagNum1Content1 = $("#con div:eq(0) a:eq(0)");
    _EsdDynamicTransformationScript.esd1TagNum2Content1 = $("#con div:eq(1) a:eq(0)");

    //各个选项中的最后一个内容
    _EsdDynamicTransformationScript.esd1TagNum1ContentN = $("#con div:eq(0) a:eq(" + _EsdDynamicTransformationScript.num1 + ")");
    _EsdDynamicTransformationScript.esd1TagNum2ContentN = $("#con div:eq(1) a:eq(" + _EsdDynamicTransformationScript.num2 + ")");

    //第一块
    _EsdDynamicTransformationScript.esd1TagNum1.focus(function (e) {

        e = $(this).mouseover();
        $(document).bind("keydown.keydown_1", function (e) {
            if (e.shiftKey && e.keyCode == 9) {}
            else if (e.keyCode == 9) {
                _EsdDynamicTransformationScript.esd1TagNum1Content1.focus();
                console.log(document.activeElement);
                return false;
            }
        });

    });
    _EsdDynamicTransformationScript.esd1TagNum1.blur(function () {

        $(document).unbind("keydown.keydown_1");
    });

    _EsdDynamicTransformationScript.esd1TagNum1Content1.focus(function () {
        $(document).bind("keydown.keydown_s1", function (e) {
            if (e.shiftKey && e.keyCode == 9) {
                _EsdDynamicTransformationScript.esd1TagNum1.focus();
                return false;
            }
        });
    });
    _EsdDynamicTransformationScript.esd1TagNum1Content1.blur(function () {
        $(document).unbind("keydown.keydown_s1");
    });

    _EsdDynamicTransformationScript.esd1TagNum1ContentN.focus(function () {
        $(document).bind("keydown.keydown_e1", function (e) {
            if (e.shiftKey && e.keyCode == 9) {}
            else if (e.keyCode == 9) {
                _EsdDynamicTransformationScript.esd1TagNum2.focus();
                return false;
            }
        });
    });
    _EsdDynamicTransformationScript.esd1TagNum1ContentN.blur(function () {
        $(document).unbind("keydown.keydown_e1");
    });

    //第二块
    _EsdDynamicTransformationScript.esd1TagNum2.focus(function (e) {
        e = $(this).mouseover();
        $(document).bind("keydown.keydown_2", function (e) {
            if (e.shiftKey && e.keyCode == 9) {
                _EsdDynamicTransformationScript.esd1TagNum1.mouseover();
                _EsdDynamicTransformationScript.esd1TagNum1ContentN.focus();
                return false;
            } else if (e.keyCode == 9) {
                _EsdDynamicTransformationScript.esd1TagNum2Content1.focus();
                console.log(document.activeElement);
                return false;
            }
        });

    });
    _EsdDynamicTransformationScript.esd1TagNum2.blur(function () {
        $(document).unbind("keydown.keydown_2");
    });

    //第二部分
    //各个选项名称对应的内容数量
    _EsdDynamicTransformationScript.num3 = $("#con2 div:eq(0) a").length - 1;
    _EsdDynamicTransformationScript.num4 = $("#con2 div:eq(1) a").length - 1;

    //各个选项名称
    _EsdDynamicTransformationScript.esd2TagNum1 = $("#tit2 li:eq(0) a");
    _EsdDynamicTransformationScript.esd2TagNum2 = $("#tit2 li:eq(1) a");

    //各个选项中的第一个内容
    _EsdDynamicTransformationScript.esd2TagNum1Content1 = $("#con2 div:eq(0) a:eq(0)");
    _EsdDynamicTransformationScript.esd2TagNum2Content1 = $("#con2 div:eq(1) a:eq(0)");

    //各个选项中的最后一个内容
    _EsdDynamicTransformationScript.esd2TagNum1ContentN = $("#con2 div:eq(0) a:eq(" + _EsdDynamicTransformationScript.num3 + ")");
    _EsdDynamicTransformationScript.esd2TagNum2ContentN = $("#con2 div:eq(1) a:eq(" + _EsdDynamicTransformationScript.num4 + ")");

    //第一块
    _EsdDynamicTransformationScript.esd2TagNum1.focus(function (e) {

        e = $(this).mouseover();
        $(document).bind("keydown.keydown_1", function (e) {
            if (e.shiftKey && e.keyCode == 9) {}
            else if (e.keyCode == 9) {
                _EsdDynamicTransformationScript.esd2TagNum1Content1.focus();
                console.log(document.activeElement);
                return false;
            }
        });

    });
    _EsdDynamicTransformationScript.esd2TagNum1.blur(function () {

        $(document).unbind("keydown.keydown_1");
    });

    _EsdDynamicTransformationScript.esd2TagNum1Content1.focus(function () {
        $(document).bind("keydown.keydown_s1", function (e) {
            if (e.shiftKey && e.keyCode == 9) {
                _EsdDynamicTransformationScript.esd2TagNum1.focus();
                return false;
            }
        });
    });
    _EsdDynamicTransformationScript.esd2TagNum1Content1.blur(function () {
        $(document).unbind("keydown.keydown_s1");
    });

    _EsdDynamicTransformationScript.esd2TagNum1ContentN.focus(function () {
        $(document).bind("keydown.keydown_e1", function (e) {
            if (e.shiftKey && e.keyCode == 9) {}
            else if (e.keyCode == 9) {
                _EsdDynamicTransformationScript.esd2TagNum2.focus();
                return false;
            }
        });
    });
    _EsdDynamicTransformationScript.esd2TagNum1ContentN.blur(function () {
        $(document).unbind("keydown.keydown_e1");
    });

    //第二块
    _EsdDynamicTransformationScript.esd2TagNum2.focus(function (e) {
        e = $(this).mouseover();
        $(document).bind("keydown.keydown_2", function (e) {
            if (e.shiftKey && e.keyCode == 9) {
                _EsdDynamicTransformationScript.esd2TagNum1.mouseover();
                _EsdDynamicTransformationScript.esd2TagNum1ContentN.focus();
                return false;
            } else if (e.keyCode == 9) {
                _EsdDynamicTransformationScript.esd2TagNum2Content1.focus();
                console.log(document.activeElement);
                return false;
            }
        });

    });
    _EsdDynamicTransformationScript.esd2TagNum2.blur(function () {
        $(document).unbind("keydown.keydown_2");
    });

    // ---------------------------- 国务院iframe 开始 -----------------------------

    //将iframe所包含的a链接数 第一个a元素 最后一个a元素赋值给第一个参数的js对象
    _EsdDynamicTransformationScript.getIframeInfos = function (jsObj, iframeObj) {
        if (iframeObj != undefined) {
            jsObj.aLink_num = iframeObj.contentWindow.document.getElementsByTagName("a").length;
            jsObj.first_aLink = iframeObj.contentWindow.document.getElementsByTagName("a")[0];
            jsObj.last_aLink = iframeObj.contentWindow.document.getElementsByTagName("a")[jsObj.aLink_num - 1];
            jsObj.self = iframeObj;
        }
    };

    //声明iframe操作对象
    _EsdDynamicTransformationScript.iframe1 = {};
    _EsdDynamicTransformationScript.iframe2 = {};

    _EsdDynamicTransformationScript.iframeElement1 = document.getElementsByTagName("iframe")[0]; // 需要修改 这里的iframe获取
    _EsdDynamicTransformationScript.iframeElement2 = document.getElementsByTagName("iframe")[1]; // 需要修改 这里的iframe获取

    //选项卡标签 jquery对象
    _EsdDynamicTransformationScript.iframeTab1 = $("#tit1 li:eq(0) a"); // 需要修改 这里的tab获取
    _EsdDynamicTransformationScript.iframeTab2 = $("#tit1 li:eq(1) a"); // 需要修改 这里的tab获取

    // 判断iframe是否有效
    if ((_EsdDynamicTransformationScript.iframeElement1 != undefined) && (_EsdDynamicTransformationScript.iframeElement2 != undefined)) {

        // 当iframe都加载完毕后执行代码 使用setInterval
        _EsdDynamicTransformationScript.iframeInterval = setInterval(function () {

                if ((_EsdDynamicTransformationScript.iframeElement1.contentWindow.document.getElementsByTagName("a")[0] != undefined)
                     && _EsdDynamicTransformationScript.iframeElement2.contentWindow.document.getElementsByTagName("a")[0] != undefined) {
                    clearInterval(_EsdDynamicTransformationScript.iframeInterval);

                    //通过方法赋值
                    _EsdDynamicTransformationScript.getIframeInfos(_EsdDynamicTransformationScript.iframe1, _EsdDynamicTransformationScript.iframeElement1);
                    _EsdDynamicTransformationScript.getIframeInfos(_EsdDynamicTransformationScript.iframe2, _EsdDynamicTransformationScript.iframeElement2);

                    //第一个标签 切换
                    _EsdDynamicTransformationScript.iframeTab1.focus(function (e) {
                        console.log("tab1获取到焦点");
                        e = $(this).mouseover();
                        $(document).bind("keydown.iframeKeydown_1", function (e) {
                            if (e.shiftKey && e.keyCode == 9) {
                                console.log("tab1向回切换");
                                //_EsdDynamicTransformationScript.iframeTab1.trigger("blur");
                                $(".zly_tbbg3.zly_20180914bt:eq(1) H2 A").focus();
                                return false;
                            } else if (e.keyCode == 9) {
                                console.log("tab1继续切换到iframe上");
                                _EsdDynamicTransformationScript.iframeTab1.trigger("blur");
                                $(_EsdDynamicTransformationScript.iframe1.self).focus();
                                console.log(document.activeElement);
                                return false;
                            }
                        });
                    });
                    _EsdDynamicTransformationScript.iframeTab1.blur(function () {
                        $(document).unbind("keydown.iframeKeydown_1");
                    });

                    //第一个标签的第一个链接
                    $(_EsdDynamicTransformationScript.iframe1.first_aLink).focus(function () {
                        console.log("第一个iframe的第一条获得焦点");
                        $(_EsdDynamicTransformationScript.iframe1.self.contentWindow.document).bind("keydown.iframeKeydown_first1", function (e) {
                            if (e.shiftKey && e.keyCode == 9) {
                                console.log("第一个iframe的第一条向上切换");
                                $(document).trigger("blur");
                                _EsdDynamicTransformationScript.iframeTab1.focus();
                                return false;
                            } else if (e.keyCode == 9) {
                                console.log("第一个iframe的第一条继续切换");
                            }
                        });
                    });
                    $(_EsdDynamicTransformationScript.iframe1.first_aLink).blur(function () {
                        $(_EsdDynamicTransformationScript.iframe1.self.contentWindow.document).unbind("keydown.iframeKeydown_first1");
                    });

                    //第一个标签的最后一个链接
                    $(_EsdDynamicTransformationScript.iframe1.last_aLink).focus(function () {
                        console.log("第一个iframe的最后一条获得焦点");
                        $(_EsdDynamicTransformationScript.iframe1.self.contentWindow.document).bind("keydown.iframeKeydown_first1", function (e) {
                            if (e.shiftKey && e.keyCode == 9) {
                                console.log("第一个iframe的最后一条向上切换");
                            } else if (e.keyCode == 9) {
                                console.log("第一个iframe的最后一条继续切换 到下一个标签");
                                $(document).trigger("blur");
                                _EsdDynamicTransformationScript.iframeTab2.focus();
                                return false;
                            }
                        });
                    });
                    $(_EsdDynamicTransformationScript.iframe1.last_aLink).blur(function () {
                        $(_EsdDynamicTransformationScript.iframe1.self.contentWindow.document).unbind("keydown.iframeKeydown_first1");
                    });

                    //第二个标签切换
                    _EsdDynamicTransformationScript.iframeTab2.focus(function (e) {
                        console.log("tab2获取到焦点");
                        e = $(this).mouseover();
                        $(document).bind("keydown.iframeKeydown_2", function (e) {
                            if (e.shiftKey && e.keyCode == 9) {
                                console.log("第二个标签向回切换 到第一个标签的最后一条");
                                _EsdDynamicTransformationScript.iframeTab2.trigger("blur");
                                _EsdDynamicTransformationScript.iframeTab1.mouseover();
                                $(_EsdDynamicTransformationScript.iframe1.last_aLink).focus();
                                return false;
                            } else if (e.keyCode == 9) {
                                _EsdDynamicTransformationScript.iframeTab2.trigger("blur");
                                $(_EsdDynamicTransformationScript.iframe2.self).focus();
                                console.log(document.activeElement);
                                return false;
                            }
                        });

                    });
                    _EsdDynamicTransformationScript.iframeTab2.blur(function () {
                        $(document).unbind("keydown.iframeKeydown_2");
                    });
                }

            }, 500);

    }
    // ---------------------------- 国务院iframe 结束 -----------------------------

    //-------------------------------动漫统计轮播 开始--------------------------------------
    $(".zly_dm a:first").focus(function (e) {  //动漫统计 连接
        $(this).bind("keydown", function (e) {
            if (e.shiftKey && e.keyCode == 9) {
            	
            } else if (e.keyCode == 9) {
            	$(".zly_dm .nums a:eq(0)").mouseover();
            	$(".zly_dm .nums a:eq(0)").focus();
            	return false;
            }
        });

    });
    $(".zly_dm a:first").blur(function () {
        $(this).unbind("keydown");
    });
    
    $(".zly_dm .nums a:eq(0)").focus(function (e) {  //动漫统计 第一个轮播按钮 连接
        $(this).bind("keydown", function (e) {
            if (e.shiftKey && e.keyCode == 9) {
            	$(".zly_dm a:first").focus();
            	return false;
            } else if (e.keyCode == 9) {
            	$(".zly_dm .nums a:eq(1)").mouseover();
            	$(".zly_dm .nums a:eq(1)").focus();
            	return false;
            }
        });

    });
    $(".zly_dm .nums a:eq(0)").blur(function () {
        $(this).unbind("keydown");
    });
    
    $(".zly_dm .nums a:eq(1)").focus(function (e) {  //动漫统计 第二个轮播按钮 连接
        $(this).bind("keydown", function (e) {
            if (e.shiftKey && e.keyCode == 9) {
            	$(".zly_dm .nums a:eq(0)").mouseover();
            	$(".zly_dm .nums a:eq(0)").focus();
            	return false;
            } else if (e.keyCode == 9) {
            	$(".zly_dm .nums a:eq(2)").mouseover();
            	$(".zly_dm .nums a:eq(2)").focus();
            	return false;
            }
        });

    });
    $(".zly_dm .nums a:eq(1)").blur(function () {
        $(this).unbind("keydown");
    });
    
    $(".zly_dm .nums a:eq(2)").focus(function (e) {  //动漫统计 第三个轮播按钮 连接
        $(this).bind("keydown", function (e) {
            if (e.shiftKey && e.keyCode == 9) {
            	$(".zly_dm .nums a:eq(1)").mouseover();
            	$(".zly_dm .nums a:eq(1)").focus();
            	return false;
            } else if (e.keyCode == 9) {
            	$(".zly_qzul a:first").focus();
            	return false;
            }
        });

    });
    $(".zly_dm .nums a:eq(2)").blur(function () {
        $(this).unbind("keydown");
    });
    
    $(".zly_qzul a:first").focus(function (e) {  //动漫统计 下方债权清单
        $(this).bind("keydown", function (e) {
            if (e.shiftKey && e.keyCode == 9) {
            	$(".zly_dm .nums a:eq(2)").mouseover();
            	$(".zly_dm .nums a:eq(2)").focus();
            	return false;
            } else if (e.keyCode == 9) {
            	
            }
        });

    });
    $(".zly_qzul a:first").blur(function () {
        $(this).unbind("keydown");
    });
    //-------------------------------动漫统计轮播 结束--------------------------------------
}
/**
 * 二级页
 */

// -------------------------------二级页------------------------------------
	if(location.href=="http://tjj.jl.gov.cn/zwgk/"){ //政务公开
		
		//各个选项名称对应的内容数量
	    _EsdDynamicTransformationScript.num1 = $("#con div:eq(0) a").length - 1;
	    _EsdDynamicTransformationScript.num2 = $("#con div:eq(1) a").length - 1;

	    //各个选项名称
	    _EsdDynamicTransformationScript.esd1TagNum1 = $("#tit li:eq(0) a");
	    _EsdDynamicTransformationScript.esd1TagNum2 = $("#tit li:eq(1) a");

	    //各个选项中的第一个内容
	    _EsdDynamicTransformationScript.esd1TagNum1Content1 = $("#con div:eq(0) a:eq(0)");
	    _EsdDynamicTransformationScript.esd1TagNum2Content1 = $("#con div:eq(1) a:eq(0)");

	    //各个选项中的最后一个内容
	    _EsdDynamicTransformationScript.esd1TagNum1ContentN = $("#con div:eq(0) a:eq(" + _EsdDynamicTransformationScript.num1 + ")");
	    _EsdDynamicTransformationScript.esd1TagNum2ContentN = $("#con div:eq(1) a:eq(" + _EsdDynamicTransformationScript.num2 + ")");

	    //第一块
	    _EsdDynamicTransformationScript.esd1TagNum1.focus(function (e) {

	        e = $(this).mouseover();
	        $(document).bind("keydown.keydown_1", function (e) {
	            if (e.shiftKey && e.keyCode == 9) {}
	            else if (e.keyCode == 9) {
	                _EsdDynamicTransformationScript.esd1TagNum1Content1.focus();
	                console.log(document.activeElement);
	                return false;
	            }
	        });

	    });
	    _EsdDynamicTransformationScript.esd1TagNum1.blur(function () {

	        $(document).unbind("keydown.keydown_1");
	    });

	    _EsdDynamicTransformationScript.esd1TagNum1Content1.focus(function () {
	        $(document).bind("keydown.keydown_s1", function (e) {
	            if (e.shiftKey && e.keyCode == 9) {
	                _EsdDynamicTransformationScript.esd1TagNum1.focus();
	                return false;
	            }
	        });
	    });
	    _EsdDynamicTransformationScript.esd1TagNum1Content1.blur(function () {
	        $(document).unbind("keydown.keydown_s1");
	    });

	    _EsdDynamicTransformationScript.esd1TagNum1ContentN.focus(function () {
	        $(document).bind("keydown.keydown_e1", function (e) {
	            if (e.shiftKey && e.keyCode == 9) {}
	            else if (e.keyCode == 9) {
	                _EsdDynamicTransformationScript.esd1TagNum2.focus();
	                return false;
	            }
	        });
	    });
	    _EsdDynamicTransformationScript.esd1TagNum1ContentN.blur(function () {
	        $(document).unbind("keydown.keydown_e1");
	    });

	    //第二块
	    _EsdDynamicTransformationScript.esd1TagNum2.focus(function (e) {
	        e = $(this).mouseover();
	        $(document).bind("keydown.keydown_2", function (e) {
	            if (e.shiftKey && e.keyCode == 9) {
	                _EsdDynamicTransformationScript.esd1TagNum1.mouseover();
	                _EsdDynamicTransformationScript.esd1TagNum1ContentN.focus();
	                return false;
	            } else if (e.keyCode == 9) {
	                _EsdDynamicTransformationScript.esd1TagNum2Content1.focus();
	                console.log(document.activeElement);
	                return false;
	            }
	        });

	    });
	    _EsdDynamicTransformationScript.esd1TagNum2.blur(function () {
	        $(document).unbind("keydown.keydown_2");
	    });
		
	    $("#con>div:eq(1) a:first").focus(function () { 
			$(this).bind("keydown.keydown_zwgk1", function (e) {
				if (e.shiftKey && e.keyCode == 9) {
					$(".zly_tbbg12 a:eq(0)").focus();
					return false;
				} else if (e.keyCode == 9) {
					
				}
			});
		});
		$("#con>div:eq(1) a:first").blur(function () {
			$(this).unbind("keydown.keydown_zwgk1");
		});
		
	    
	    $(".zly_more_2018:eq(1) a").focus(function () { // 	 人事任免-->重要会议 
			$(this).bind("keydown.keydown_zwgk1", function (e) {
				if (e.shiftKey && e.keyCode == 9) {
					
				} else if (e.keyCode == 9) {
					$(".zly_tbbg6").mouseover();
					$(".zly_tbbg6 a").focus();
					return false;
				}
			});
		});
		$(".zly_more_2018:eq(1) a").blur(function () {
			$(this).unbind("keydown.keydown_zwgk1");
		});
		
		$(".zly_tbbg6 a").focus(function () {  //重要会议 
			$(this).bind("keydown.keydown_zwgk2", function (e) {
				if (e.shiftKey && e.keyCode == 9) {
					$(".zly_tbbg12:eq(0)").mouseover();
					$(".zly_more_2018:eq(1) a").focus();
					return false;
				} else if (e.keyCode == 9) {
					
				}
			});
		});
		$(".zly_tbbg6 a").blur(function () {
			$(this).unbind("keydown.keydown_zwgk2");
		});
		
		$(".zly_20180914bt:eq(0) a").focus(function () {  //重要会议 
			$(this).bind("keydown.keydown_zwgk3", function (e) {
				if (e.shiftKey && e.keyCode == 9) {
					$(".zly_tbbg6").mouseover();
					$(".zly_more_2018:eq(2) a").focus();
					return false;
				} else if (e.keyCode == 9) {
					
				}
			});
		});
		$(".zly_20180914bt:eq(0) a").blur(function () {
			$(this).unbind("keydown.keydown_zwgk3");
		});
		
	}
	
	if(location.href=="http://tjj.jl.gov.cn/tjsj/"){
		//第一部分
		//二层  

		//各个选项名称对应的内容数量
		_EsdDynamicTransformationScript.num1 = $("#con div:eq(0) a").length-1;
		_EsdDynamicTransformationScript.num2 = $("#con div:eq(1) a").length-1;
		
		//各个选项名称
		_EsdDynamicTransformationScript.esd1TagNum1 = $("#tit li:eq(0) a");
		_EsdDynamicTransformationScript.esd1TagNum2 = $("#tit li:eq(1) a");
		
		//各个选项中的第一个内容
		_EsdDynamicTransformationScript.esd1TagNum1Content1 = $("#con div:eq(0) a:eq(0)");
		_EsdDynamicTransformationScript.esd1TagNum2Content1 = $("#con div:eq(1) a:eq(0)");
		
		//各个选项中的最后一个内容
		_EsdDynamicTransformationScript.esd1TagNum1ContentN = $("#con div:eq(0) a:eq("+_EsdDynamicTransformationScript.num1+")");
		_EsdDynamicTransformationScript.esd1TagNum2ContentN = $("#con div:eq(1) a:eq("+_EsdDynamicTransformationScript.num2+")");
		
		//第一块
		_EsdDynamicTransformationScript.esd1TagNum1.focus(function (e) {
			
			e = $(this).mouseover();
			$(document).bind("keydown.keydown_1", function (e) {
				if(e.shiftKey&&e.keyCode==9){
					
				}else if (e.keyCode == 9) {
					_EsdDynamicTransformationScript.esd1TagNum1Content1.focus();
					console.log(document.activeElement);
					return false;
				}
			});

		});
		_EsdDynamicTransformationScript.esd1TagNum1.blur(function () {
			
			$(document).unbind("keydown.keydown_1");
		});

		_EsdDynamicTransformationScript.esd1TagNum1Content1.focus(function () {
			$(document).bind("keydown.keydown_s1", function (e) {
				if (e.shiftKey && e.keyCode == 9) {
					_EsdDynamicTransformationScript.esd1TagNum1.focus();
					return false;
				}
			});
		});
		_EsdDynamicTransformationScript.esd1TagNum1Content1.blur(function () {
			$(document).unbind("keydown.keydown_s1");
		});

		_EsdDynamicTransformationScript.esd1TagNum1ContentN.focus(function () {
			$(document).bind("keydown.keydown_e1", function (e) {
				if(e.shiftKey&&e.keyCode==9){
					
				}else if (e.keyCode == 9) {
					_EsdDynamicTransformationScript.esd1TagNum2.focus();
					return false;
				}
			});
		});
		_EsdDynamicTransformationScript.esd1TagNum1ContentN.blur(function () {
			$(document).unbind("keydown.keydown_e1");
		});
		
		//第二块
		_EsdDynamicTransformationScript.esd1TagNum2.focus(function (e) {
			e = $(this).mouseover();
			$(document).bind("keydown.keydown_2", function (e) {
				if(e.shiftKey&&e.keyCode==9){
					_EsdDynamicTransformationScript.esd1TagNum1.mouseover();
					_EsdDynamicTransformationScript.esd1TagNum1ContentN.focus();
					return false;
				}else if (e.keyCode == 9) {
					_EsdDynamicTransformationScript.esd1TagNum2Content1.focus();
					console.log(document.activeElement);
					return false;
				}
			});

		});
		_EsdDynamicTransformationScript.esd1TagNum2.blur(function () {
			$(document).unbind("keydown.keydown_2");
		});
		
	}
	
/**
 * 共通底部处理
 */
//定义跳转 使用jquery选择器语法
	//主要修改部分把网站对应的选择器赋值给相应的变量。或用jquery把默认的id复制给网站的元素****************************此处重要位置修改
	_EsdDynamicTransformationScript.navBlock.selector.top = ".zly_c";
	_EsdDynamicTransformationScript.navBlock.selector.nav = ".con";
	_EsdDynamicTransformationScript.navBlock.selector.footer = "iframe:last";
	_EsdDynamicTransformationScript.navBlock.selector.main = ".zly_bgc";    
	_EsdDynamicTransformationScript.navBlock.selector.left = "";  
	_EsdDynamicTransformationScript.navBlock.selector.right = "";
	_EsdDynamicTransformationScript.navBlock.selector.content = ".zly_sjy_txtc";

	//给栏目的class属性添加navBlock值来标识这是需要切的栏目区块。
	_EsdDynamicTransformationScript.navBlock.activateArray = [
		".zly_c", ".con", ".zly_bgc", "#demo3", ".zly_yq:eq(0)", ".zly_tzgg:eq(0)", ".zly_yq:eq(1)", "#demo1", ".zly_tzgg:eq(1)", ".zly_yq:eq(2)",
		".zly_lb:eq(4)", ".zly_tzgg:eq(2)", ".zly_yq:eq(3)", ".zly_lb:eq(6)", ".w371", ".zly_tjfg", ".zly_jzxxul_li",
		".zly_sjy_txtc", "iframe:last"
	]

	for(var i=0; i<_EsdDynamicTransformationScript.navBlock.activateArray.length;i++){
		$(_EsdDynamicTransformationScript.navBlock.activateArray[i]).addClass("navBlock");
	}
/**
 * 区域导航、调试开关
 */

$(document).bind("keydown.keydown_9001", function(e) {
	if (e.shiftKey && e.keyCode == 20) {
		$("*").focus(function() {
			$(this).css({
				"outline" : "2px dashed red"
			});
		});
		$("*").blur(function() {
			$(this).css({
				"outline" : "0px black"
			});
		});
	}
});

_EsdDynamicTransformationScript.navBlock.debug = true; // 是否是调试模式，调试模式有红边线，非调试模式关闭红边框
_EsdDynamicTransformationScript.navBlock.selector.activate = ".navBlock"; // 激活的采用class因为会激活多个
// 快捷键定义区
//_EsdDynamicTransformationScript.navBlock.key = {};

//_EsdDynamicTransformationScript.navBlock.key.top = "alt+1"; // (top)
//_EsdDynamicTransformationScript.navBlock.key.nav = "alt+2"; // (nav)
//_EsdDynamicTransformationScript.navBlock.key.main = "alt+3"; // (main)
//_EsdDynamicTransformationScript.navBlock.key.content = "alt+4"; // (content)
//_EsdDynamicTransformationScript.navBlock.key.left = "alt+5"; // (left)
//_EsdDynamicTransformationScript.navBlock.key.right = "alt+6"; // (right)
//_EsdDynamicTransformationScript.navBlock.key.footer = "alt+7"; // (footer)
//_EsdDynamicTransformationScript.navBlock.key.down = "alt+8"; // (down)
//_EsdDynamicTransformationScript.navBlock.key.up = "alt+9"; // (up);

// 以下变量主要用于区块跳转
_EsdDynamicTransformationScript.navBlock.sIndex = -1; // 当前栏目下标
_EsdDynamicTransformationScript.navBlock.maxIndex = -1; // 保存目前所有class="navBlock"的区域块总数量，栏目总量下标。
_EsdDynamicTransformationScript.navBlock.minIndex = 0; // 栏目数量起始下标

// 主要代码区域

// 导航跳转
_EsdDynamicTransformationScript.navBlock.keyShowSelect = function(i) {
	$(_EsdDynamicTransformationScript.navBlock.selector.activate).each(function(index, el) {
		if (i == index) {
			_EsdDynamicTransformationScript.navBlock.debugView(el);
			$(el).find("a").each(function(i, e) {
				if (i == 0) {
					$(e).focus();
				}
			});

		}
	});
}

// 获取所有class=navBlock的区域的总数量，初始化轮训所有需要跳转的块
$(_EsdDynamicTransformationScript.navBlock.selector.activate).each(function(index, ehx) {
	_EsdDynamicTransformationScript.navBlock.maxIndex++;
});



// 快捷键功能区域
// 跳转到头部alt+1(49)
$(document).keydown(function(e) {
	if (e.altKey && e.keyCode == 49) {
		_EsdDynamicTransformationScript.navBlock.keySelectScroll(_EsdDynamicTransformationScript.navBlock.selector.top);
	}

});
// 跳转到导航alt+2(50)
$(document).keydown(function(e) {
	if (e.altKey && e.keyCode == 50) {
		_EsdDynamicTransformationScript.navBlock.keySelectScroll(_EsdDynamicTransformationScript.navBlock.selector.nav);
	}

});
// 跳转到主要区域alt+3(51)
$(document).keydown(function(e) {
	if (e.altKey && e.keyCode == 51) {
		_EsdDynamicTransformationScript.navBlock.keySelectScroll(_EsdDynamicTransformationScript.navBlock.selector.main);
	}
});

// 跳转到正文区域alt+4(52)
$(document).keydown(function(e) {
	if (e.altKey && e.keyCode == 52) {
		_EsdDynamicTransformationScript.navBlock.keySelectScroll(_EsdDynamicTransformationScript.navBlock.selector.content);
	}
});

// 跳转到左区域alt+5(53)
$(document).keydown(function(e) {
	if (e.altKey && e.keyCode == 53) {
		_EsdDynamicTransformationScript.navBlock.keySelectScroll(_EsdDynamicTransformationScript.navBlock.selector.left);
	}
});

// 跳转到右区域alt+6(54)
$(document).keydown(function(e) {
	if (e.altKey && e.keyCode == 54) {
		_EsdDynamicTransformationScript.navBlock.keySelectScroll(_EsdDynamicTransformationScript.navBlock.selector.right);
	}
});
// 跳转到底部alt+7(55)
$(document).keydown(function(e) {
	if (e.altKey && e.keyCode == 55) {
		_EsdDynamicTransformationScript.navBlock.keySelectScroll(_EsdDynamicTransformationScript.navBlock.selector.footer);
	}
});
//前进alt+8(56)
$(document).keydown(function(e) {
	if (e.altKey && e.keyCode == 56) {
		if (_EsdDynamicTransformationScript.navBlock.sIndex < _EsdDynamicTransformationScript.navBlock.maxIndex) {
			_EsdDynamicTransformationScript.navBlock.sIndex++;
			_EsdDynamicTransformationScript.navBlock.keyShowSelect(_EsdDynamicTransformationScript.navBlock.sIndex);
		}
	}
});

// 后退alt+9(57)
$(document).keydown(function(e) {
	if (e.altKey && e.keyCode == 57) {
		if (_EsdDynamicTransformationScript.navBlock.sIndex > _EsdDynamicTransformationScript.navBlock.minIndex) {
			_EsdDynamicTransformationScript.navBlock.sIndex--;
			_EsdDynamicTransformationScript.navBlock.keyShowSelect(_EsdDynamicTransformationScript.navBlock.sIndex);
		}
	}
});
// 特定区域跳转
_EsdDynamicTransformationScript.navBlock.keySelectScroll = function(id) {
	if ($(id).length > 0) {
		_EsdDynamicTransformationScript.navBlock.appendIns(id,true);//插入ins
		_EsdDynamicTransformationScript.navBlock.debugView(id);
		$(id).find("a").each(function(index) {
			if (index == 0) {
				$(this).focus();
			}
		});
		_EsdDynamicTransformationScript.navBlock.appendIns(id,false);//清楚ins
	} else {
	}

}
//为了解决漂浮高等于0的情况下区域显示是一条线
_EsdDynamicTransformationScript.navBlock.appendIns=function(id,b){
	if(b==true){
		$(id).append("<ins id='esdNavBlockIns' style='clear: both;display: block;'></ins>")
	}else{
		$("#esdNavBlockIns").remove();
	}
}

if (_EsdDynamicTransformationScript.navBlock.debug == true) {
	// 如果开启调试模式，添加调试绘制矩形边线
	$("body").append("<div id='show_top' class='lineshow'></div>");
	$("body").append("<div id='show_bottom' class='lineshow'></div>");
	$("body").append("<div id='show_left' class='lineshow'></div>");
	$("body").append("<div id='show_right' class='lineshow'></div>");
	$(".lineshow").css({
		"display" : "none"
	});
}
// 开启调试模式后会显示红边
_EsdDynamicTransformationScript.navBlock.debugView = function(e) {
	if (_EsdDynamicTransformationScript.navBlock.debug == true) {
		var x = $(e).offset();
		//var w = parseInt($(e).css("width"));
		var w = $(e).outerWidth();//返回元素的宽度（包含 padding 和 border）
		//var h = parseInt($(e).css("height"));
		var h = $(e).outerHeight();//返回元素的高度（包含 padding 和 border）
		$("#show_top").css({
			"z-index" : "9999",
			"border" : "red 2px solid",
			"position" : "absolute",
			"top" : x.top,
			"left" : x.left,
			"width" : w,
			"height" : "0px"
		});
		$("#show_bottom").css({
			"z-index" : "9999",
			"border" : "red 2px solid",
			"position" : "absolute",
			"top" : x.top + h,
			"left" : x.left,
			"width" : w,
			"height" : "0px"
		});
		$("#show_left").css({
			"z-index" : "9999",
			"border" : "red 2px solid",
			"position" : "absolute",
			"top" : x.top,
			"left" : x.left,
			"width" : "0px",
			"height" : h
		});
		$("#show_right").css({
			"z-index" : "9999",
			"border" : "red 2px solid",
			"position" : "absolute",
			"top" : x.top,
			"left" : x.left + w,
			"width" : "0px",
			"height" : h
		});
		$("html,body").animate({
			scrollTop : $("#show_top").offset().top
		}, 200);
		$(".lineshow").css({
			"display" : "block"
		});
	}
}
};
/**
 * 主入口方法
 */

if (window.jQuery == undefined) {
	var wzaInitInterval = setInterval(function(){	
		if(document.body!=null){
			clearInterval(wzaInitInterval);
			document.body.onload = function(){
				var esdJquery = document.createElement("script");
				esdJquery.setAttribute("type", "text/javascript");
				esdJquery.setAttribute("src", window.location.protocol + "//" + window.location.href.split("/")[2] + "/wza/bwscript/jquery-1.12.4.min.js");
				esdJquery.setAttribute("charset", "utf-8");
				esdJquery.setAttribute("id", "ESDWebAppInnerIframe");
				document.body.appendChild(esdJquery);
				var jqueryLoadInterval = setInterval(function () {
					if (window.jQuery != undefined) {
						clearInterval(jqueryLoadInterval);
						_EsdDynamicTransformationFunction(jQuery);
					}
				}, 500);
			};	
		}
	}, 500);
} else {
	jQuery(function(){
		_EsdDynamicTransformationFunction(jQuery);
	})
	
}
